<?
$smarty=new Smarty();
if(!ANTIHACK) die("ANTIHACK...");
$per=query("select `group`.`permission` as permission from user,`group` where `user`.`id`=$_SESSION[id] and `user`.`group` = `group`.`id`");
$fper=fetch($per);
$Aper=json_decode($fper['permission'],true);
$q = query("select * from admin_menu order by sort asc");
while($r=fetch($q))
{
	if($Aper[0][$r["parent"]][$r[id]] || $r["parent"]==0)
		$menu[$r["parent"]][]=$r;
}
$smarty->assign("menu",$menu);
$smarty->display("adminmenu.htm");
?>